package com.kylewang.pomodoro.model;

import com.kylewang.pomodoro.helper.Utils;

public class TaskModel {

    private String name;
    // millisecond
    private long create_time;
    // millisecond
    private long target_time;
    // millisecond
    private long elapsed_duration;
    // 0: normal, 1: running, 2: finished
    private int status;

    private boolean isCollected;

    private String tid;

    private String ownerid;

    public static TaskModel generateBlankTaskItem()  {
        TaskModel item = new TaskModel();
        item.name = "";
        item.setTarget_time(25 * 60 * 1000);
        item.setCreate_time(System.currentTimeMillis());
        return item;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getCreate_time() {
        return create_time;
    }

    public void setCreate_time(long create_time) {
        this.create_time = create_time;
    }

    public long getTarget_time() {
        return target_time;
    }

    public void setTarget_time(long target_time) {
        this.target_time = target_time;
    }

    public long getElapsed_duration() {
        return elapsed_duration;
    }

    public void setElapsed_duration(long elapsed_duration) {
        this.elapsed_duration = elapsed_duration;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public boolean isCollected() {
        return isCollected;
    }

    public void setCollected(boolean collected) {
        isCollected = collected;
    }

    public String getOwnerid() {
        return ownerid;
    }

    public void setOwnerid(String ownerid) {
        this.ownerid = ownerid;
    }

    public String getTid() {
        return tid;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public long remindsTime() {
        return target_time - elapsed_duration;
    }
    public String remindsStr() {
        return Utils.transfomTimeFromSec((int) (remindsTime()) / 1000);
    }
}
